<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="ERP人事部门备用金申请列表" bodyClass="gray-bg animated fadeInRight" isAnimation="false" libs=["table","zTree","layout-latest"]/>
<div class="container-div">
 <div class="row">
  <div class="col-sm-12 search-collapse">
    <@form.form id="deptpettycash-form" class="form-inline">
     <div class="select-list">
      <ul>
           <li>
              <label> <@ctx.i18n text = "流水号"/>：
               <input type="text" name="serialNumber"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "原因"/>：
               <input type="text" name="moneyReason"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "金额"/>：
               <input type="text" name="moneyMoney"/> </label>
            </li>
           <li>
                 <label> <@ctx.i18n text = "还款方式"/>： </label>
                <select name="moneyRepaymentMethod" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_erp_paybackmethod')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
              <label> <@ctx.i18n text = "还款期限"/>：
               <input type="text" name="moneyRepaymentTerm"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "会计人员名称"/>：
               <input type="text" name="accountingPersonname"/> </label>
            </li>
          <li class="select-time">
             <label> <@ctx.i18n text = "出纳日期"/>： </label>
            <input type="text" class="time-input" name="CashierDate"/>
        </li>
        <li>
          <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;&nbsp;<@ctx.i18n text = "查询"/></a>
          <a class="btn btn-warning btn-rounded btn-sm" onclick="opt.form.reset()"><i class="fa fa-refresh"></i>&nbsp;<@ctx.i18n text = "重置"/></a>
       </li>
      </ul>
   </div>
  </@form.form>
 </div>
  <@table id="bootstrap-table">
    <@shiro.hasPermission name="erp:deptpettycash:add">
                    <a class="btn btn-success" onclick="opt.operate.add()"><i class="fa fa-plus"></i>&nbsp;<@ctx.i18n text = "新增"/></a>
    </@shiro.hasPermission>
<!--    <@shiro.hasPermission name="erp:deptpettycash:edit">-->
<!--        <a class="btn btn-primary single disabled" onclick="opt.operate.edit()"><i class="fa fa-pencil-square-o"></i>&nbsp;<@ctx.i18n text = "修改"/></a>-->
<!--    </@shiro.hasPermission>-->
<!--    <@shiro.hasPermission name="erp:deptpettycash:del">-->
<!--        <a class="btn btn-danger multiple disabled" onclick="opt.operate.delAll()">-->
<!--            <i class="fa fa-remove"></i> <@ctx.i18n text = "删除"/>-->
<!--        </a>-->
<!--    </@shiro.hasPermission>-->
   </@table>
  <div>
</div>
<@footer>
<script>
    var editFlag = "${permission.hasPermi("erp:deptpettycash:edit")}";
    var listFlag = "${permission.hasPermi("erp:deptpettycash:add")}";
    var delFlag = "${permission.hasPermi("erp:deptpettycash:del")}";
    var visible = ${permission.isPermitteds("erp:deptpettycash:edit,erp:deptpettycash:del,erp:deptpettycash:add")?string('true', 'false')};
   var moneyRepaymentMethodDatas = ${dict.getDictListJson('sys_erp_paybackmethod')};
   var accountingApprovalDatas = ${dict.getDictListJson('sys_crm_isOrNo')};
   var managerApprovalDatas = ${dict.getDictListJson('sys_crm_isOrNo')};
   var payConfirmpayDatas = ${dict.getDictListJson('sys_crm_isOrNo')};
   var payPreferencePaymethodDatas = ${dict.getDictListJson('sys_erp_first_paymethod')};
   var payRmbRemittanceMethodDatas = ${dict.getDictListJson('sys_crm_isOrNo')};
   var cashierPaymentResultDatas = ${dict.getDictListJson('sys_crm_isOrNo')};
    var prefix = baseURL + "erp/deptpettycash";

    $(function() {
        var options = {
            url: prefix + "/list",
            addUrl: prefix + "/add",
            editUrl: prefix + "/edit/{id}",
            delUrl: prefix + "/del",
            modalName: "ERP人事部门备用金申请",
            uniqueId:    'id'/* 唯一ID */                                                                                                     ,
            escape: true,            /* 分页设置 */
            showPageGo: true,       /* 分页设置 */
            pageSize: 10,            /* 分页设置 */
            pageList: [10, 30, 50], /* 分页设置 */
            columns: [
                {title: $.i18n.prop("序号"), width: 5, align: "center", formatter: function (value, row, index) {
                            return $.table.serialNumber(index);
                }}
                ,{field : 'id',title : '<@ctx.i18n text = "主键"/>',visible: false}
              ,{field : 'serialNumber',title : '<@ctx.i18n text = "流水号"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
                     ,{field : 'moneyReason',title : '<@ctx.i18n text = "原因"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'moneyMoney',title : '<@ctx.i18n text = "金额"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
                 ,{field : 'moneyRepaymentMethod',title : '<@ctx.i18n text = "还款方式"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(moneyRepaymentMethodDatas, value); }}
              ,{field : 'moneyRepaymentTerm',title : '<@ctx.i18n text = "还款期限"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
               ,{field : 'accountingPersonname',title : '<@ctx.i18n text = "会计人员名称"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
                                    ,{field : 'cashierDate',title : '<@ctx.i18n text = "出纳日期"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
                    ,{title:"<@ctx.i18n text = '操作'/>",align: 'center',visible:visible,formatter: function(value, row, index) {
                        var actions = [];
                        //   actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="opt.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        // actions.push('<a class="btn btn-danger btn-xs ' + delFlag + '" href="javascript:void(0)" onclick="opt.operate.del(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        actions.push('<a class="btn btn-danger btn-xs ' + delFlag + '" href="javascript:void(0)" onclick="showDetail(\'' + row.id + '\')"><i class="fa fa-remove"></i>查看</a>');
                         return actions.join('');
                    }
                }

                ]
            };
            $.table.init(options);
        });
    function showDetail(id){
        opt.modal.open("查看",prefix+"/view5/"+id);
    }
</script>
</@footer>
</@pageTheme>